module.exports = (sequelize, DataTypes) => {
  const order = sequelize.define('order', {
    status: {
      type: DataTypes.INTEGER,
      defaultValue: 0 // 0 processing 1 completed 2 cancelled
    },
    disable: {
      type: DataTypes.BOOLEAN,
      defaultValue: false
    }
  })

  order.associate = (models) => {
    order.belongsToMany(models.good, {
      through: models.orderGood
    })
  }
  return order
}
